package com.ketai.web;

import com.ketai.pojo.ActivityType;
import com.ketai.service.ActityTypeService;
import com.ketai.service.impl.ActityTypeServiceImpl;
import com.ketai.util.SendUtil;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @Author:长沙科泰梦想学院-蓝色小药丸
 * @Mission:打造演说·创客型跨境电商与互联网人才
 * @Description:
 * @Date:Create In 2022/8/5 16:04
 **/

@WebServlet("/admin/actityType")
public class ActityTypeServlet extends HttpServlet {

    ActityTypeService service = new ActityTypeServiceImpl();

    @Override
    protected void doGet (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }

    @Override
    protected void doPost (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        String opr = req.getParameter("opr");
        if ("list".equals(opr)) {

            List<ActivityType> activityTypeList = service.getActivityTypeList();
            SendUtil.Sendjson(resp, activityTypeList);

        }


    }
}
